package com.xiaxiaoge.tutorialmod.entity;

import com.xiaxiaoge.tutorialmod.TutorialMod;
import com.xiaxiaoge.tutorialmod.entity.custom.DiamonsurdEntity;
import com.xiaxiaoge.tutorialmod.entity.custom.DingDongChickenEntity;
import com.xiaxiaoge.tutorialmod.entity.custom.MySnowManEntity;
import com.xiaxiaoge.tutorialmod.entity.custom.VictoriousSwiftTwoEntity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

/**
 * @author 夏小哥
 * @version 1.0
 */
public class ModEntityTypes {
    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES =
            DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, TutorialMod.MOD_ID);

    // 恐龙
    public static final RegistryObject<EntityType<DiamonsurdEntity>> DIAMONSURD =
            ENTITY_TYPES.register("diamonsurd",
                    () -> EntityType.Builder.of(DiamonsurdEntity::new, MobCategory.MONSTER)
                            .sized(0.4f, 1.5f)
                            .build(new ResourceLocation(TutorialMod.MOD_ID, "diamonsurd").toString()));

    // 新雪人
    public static final RegistryObject<EntityType<MySnowManEntity>> NewSnowMan =
            ENTITY_TYPES.register("newsnowman",
                    () -> EntityType.Builder.of(MySnowManEntity::new, MobCategory.CREATURE)
                            .sized(1F, 1F)
                            .build(new ResourceLocation(TutorialMod.MOD_ID, "newsnowman").toString()));

    // 新雪人
    public static final RegistryObject<EntityType<DingDongChickenEntity>> DING_DONG_CHICKEN =
            ENTITY_TYPES.register("dingdong_chicken",
                    () -> EntityType.Builder.of(DingDongChickenEntity::new, MobCategory.CREATURE)
                            .sized(1F, 1F)
                            .build(new ResourceLocation(TutorialMod.MOD_ID, "dingdong_chicken").toString()));

    // 胜利飞燕二号
    public static final RegistryObject<EntityType<VictoriousSwiftTwoEntity>> VICTORIOUS_SWIFT_TWO =
            ENTITY_TYPES.register("victorious_swift_two",
                    () -> EntityType.Builder.<VictoriousSwiftTwoEntity>of(VictoriousSwiftTwoEntity::new, MobCategory.MISC)
                            .build(new ResourceLocation(TutorialMod.MOD_ID, "victorious_swift_two").toString()));

    public static void register(IEventBus eventBus) {
        ENTITY_TYPES.register(eventBus);
    }
}
